<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="user-scalable=no">
  <title></title>
  <style>
    html,
    body {
      padding: 0;
      margin: 0;
    }

    #father {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      flex-direction: column;
      display: flex;
      align-items: center;
      /* justify-content: center; */
  }
  #father :first-child {
    margin-top: auto;
  }
  #father :last-child {
    margin-bottom: auto;
  }

    .son {
      background: #7985d4;
      width: 100%;
      height: 80px;
      font-size: 30px;
      line-height: 80px;
      text-align: center;
      color: #fff;
    }
    .son:nth-child(2n-1) {
      background: rgb(33, 58, 128);
    }
  </style>
</head>

<body>
  <div id="father">
    <div class="son">1</div>
    <div class="son">2</div>
    <div class="son">3</div>
    <div class="son">4</div>
    <div class="son">5</div>
  </div>
</body>

</html>